package com.huangpeng.designmodel.singleton;

/**
 * @Author hp
 * @Title 懒汉式-懒加载
 * @Package
 * @Date 2022/1/19 9:57
 * @Description
 * @Version 1.0
 */
public class SlackerLazyLoading {
    public SlackerLazyLoading() {
    }
    private static SlackerLazyLoading slackerLazyLoading;
    public static SlackerLazyLoading getInstance(){
        if(slackerLazyLoading == null){
            slackerLazyLoading = new SlackerLazyLoading();
        }
        return slackerLazyLoading;
    }
    public static void main(String[] args){
        SlackerLazyLoading a1 = SlackerLazyLoading.getInstance();
        System.out.println("*********** " + a1.hashCode());
        SlackerLazyLoading a2 = SlackerLazyLoading.getInstance();
        System.out.println("*********** " + a2.hashCode());
    }
}
